﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/MasterPage.Master" AutoEventWireup="true" CodeBehind="StatusCadastro.aspx.cs" Inherits="PopPromotoraCallCenter.Admin.StatusCadastro" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadElements" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentElements" runat="server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <Triggers>
            <asp:PostBackTrigger ControlID="btnGravar" />
        </Triggers>
        <ContentTemplate>
            <nav class="titleFilter">
                <ul>
                    <li>
                        <h1>Status</h1>
                    </li>
                </ul>
            </nav>
            <asp:HiddenField ID="hfStatusId" runat="server" Value="0" />
            <asp:MultiView ID="mvStatus" runat="server" ActiveViewIndex="0">
                <asp:View runat="server" ID="View1">
                    <asp:Button ID="btnNovo" runat="server" Text="Novo Status" CssClass="BotaoForm" OnClick="btnNovo_Click" />
                    <br />
                    <asp:Label ID="lblMsgGrid" runat="server" Text="" CssClass="msgErro"></asp:Label><br />
                    <asp:GridView ID="gvStatus" runat="server"
                        DataKeyNames="idStatus,fgAtivo" AutoGenerateColumns="False" CellPadding="4"
                        OnRowCommand="gvStatus_RowCommand" OnRowDataBound="gvStatus_RowDataBound" CssClass="report">
                        <Columns>
                            <asp:BoundField HeaderText="Nome" DataField="nome" />
                            <asp:BoundField HeaderText="Descrição" DataField="descricao" />
                            <asp:BoundField HeaderText="Status" DataField="fgAtivo" />
                            <asp:TemplateField HeaderText="Editar">
                                <ItemStyle HorizontalAlign="Center" />
                                <ItemTemplate>
                                    <asp:ImageButton ID="btnEditar" runat="server" CssClass="BotaoForm" CommandArgument='<%# Eval("idStatus") %>'
                                        CommandName="editar" ToolTip="Editar" ImageUrl="../Styles/Images/editar.png" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Desabilitar">
                                <ItemStyle HorizontalAlign="Center" />
                                <ItemTemplate>
                                    <asp:ImageButton ID="btnStatus" runat="server" CssClass="BotaoForm"
                                        CommandArgument='<%# Container.DataItemIndex %>' CommandName="status" ToolTip="Desabilitar" ImageUrl="../Styles/Images/desabilitar.png" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Excluir">
                                <ItemStyle HorizontalAlign="Center" />
                                <ItemTemplate>
                                    <asp:ImageButton ID="btnExcluir" runat="server" CssClass="BotaoForm" CommandArgument='<%# Eval("idStatus") %>'
                                        CommandName="excluir" ToolTip="Excluir" ImageUrl="../Styles/Images/lixeira.png" />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </asp:View>
                <asp:View runat="server" ID="View2">
                    <div class="formFill">
                        <table>
                            <tr>
                                <th>
                                    <label>
                                        Nome Status
                                    </label>
                                </th>
                                <td>
                                    <asp:TextBox ID="txtNome" CssClass="CampoForm" Width="286" MaxLength="100" runat="server"></asp:TextBox>
                                </td>
                                <th>
                                    <label>
                                        Ativo
                                    </label>
                                </th>
                                <td>
                                    <asp:CheckBox ID="cbAtivo" runat="server" /></li>
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <label>
                                        Descrição
                                    </label>
                                </th>
                                <td colspan="3">
                                    <asp:TextBox ID="txtDescricao" CssClass="CampoForm" MaxLength="500" TextMode="MultiLine" Rows="5" Columns="50" runat="server"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="4" style="text-align: center">
                                    <asp:Button ID="btnGravar" CssClass="BotaoForm" runat="server" Text="Gravar" OnClick="btnGravar_Click" />&nbsp;&nbsp;
                                        <asp:Button ID="btnVoltar" CssClass="BotaoForm" runat="server" Text="Voltar" OnClick="btnVoltar_Click" />
                                </td>
                            </tr>
                        </table>
                    </div>
                </asp:View>
            </asp:MultiView>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
